import request from '@/utils/request'

// 获取轮播图列表
export const getBannerList = () => {
  return request({
    url: '/banners',
    method: 'get'
  })
}

// 改变轮播图状态
export const bannerSwitch = (data) => {
  return request({
    url: '/banners/isuse',
    method: 'post',
    data
  })
}

// 更改轮播图内容
export const changBanner = (id, data) => {
  return request({
    url: `/banners/${id}`,
    method: 'put',
    'Content-Type': 'multipart/form-data',
    data
  })
}

// 添加轮播图
export const addBanner = (data) => {
  return request({
    url: '/banners',
    method: 'post',
    data
  })
}

// 删除轮播图
export const removeBanner = (id) => {
  return request({
    url: `/banners/${id}`,
    method: 'delete'
  })
}
